<template>
  <view style="text-align:center;">
    <image :src="qrcodeSrc" mode="aspectFit" style="width: 300px; height: 300px;"></image>
  </view>
</template>

<script>
	import QRCode from 'qrcode'
	export default {
		data() {
			return {
				qrcodeSrc: ''
			}
		},
		onReady() {
			// this.getUserInfo();
			this.createQrcode('https://app.gluz.com.cn/h5/pages/user/register/register');
			uni.setNavigationBarTitle({
				title: this.$t("分享")
			})
		},
		methods: {
			// async getUserInfo() {
			// 	const that = this
			// 	let user = await that.$u.api.user.getUserInfo();
			// 	this.userInfo = user
			// 	this.userInfo.avatar = IMAGE_URL + this.userInfo.avatar
			// 	// 俄罗斯国籍，去掉积分
			// 	if (this.userInfo.country.value === '1' || this.off == false) {
			// 		this.list.splice(6, 1)
			// 	}
			// 	this.loading = true
			// },
			createQrcode(text) {
			  QRCode.toDataURL(text)
				.then(url => {
				  this.qrcodeSrc = url
				})
				.catch(err => {
				  console.error(err)
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
</style>